<%@ page import="java.io.File" %>
<%@ page import="java.io.OutputStream" %>
<%@ page import="java.io.FileOutputStream" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
</head>
<body>
<form action="upload.jsp" method="post" enctype="multipart/form-data">
    <input type="file" name="file1" />
    <input type="file" name="file2" />
    <input type="file" name="file3" />
    <button type="submit">upload</button>
</form>
<%
    File file = new File ("d:/tmp/out.txt");
    OutputStream output = new FileOutputStream (file);
    ServletInputStream in = request.getInputStream ();
    byte[] buff = new byte[1024];
    int length;
    while ((length = in.read (buff)) != -1) {
        output.write (buff,  0, length);
    }
    output.flush ();
    output.close ();
%>
</body>
</html>